﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Enterprise.Migrations
{
    public partial class deletePojecttables : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ProjectPersonal");

            migrationBuilder.DropTable(
                name: "ProjectTeam");

            migrationBuilder.DropTable(
                name: "ProjectTeamOperator");

            migrationBuilder.DropTable(
                name: "Requirement");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ProjectPersonal",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    ClientTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    EnvironmentDevTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    EnvironmentOSTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    OperatorID = table.Column<Guid>(nullable: false),
                    ProjectDescription = table.Column<string>(type: "nvarchar(2000)", nullable: true),
                    ProjectTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    ProjectTitle = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    TenantId = table.Column<int>(nullable: false),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProjectPersonal", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ProjectTeam",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    ActualFinish = table.Column<DateTime>(nullable: true),
                    ActualStart = table.Column<DateTime>(nullable: true),
                    ClientTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    CreateOperator = table.Column<Guid>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    EnvironmentDevTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    EnvironmentOSTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    OperatorID = table.Column<Guid>(nullable: false),
                    PlanFinish = table.Column<DateTime>(nullable: true),
                    PlanStart = table.Column<DateTime>(nullable: true),
                    ProjectDescription = table.Column<string>(type: "nvarchar(2000)", nullable: true),
                    ProjectTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    ProjectTitle = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    RequirementID = table.Column<int>(nullable: true),
                    Status = table.Column<int>(nullable: false),
                    TenantId = table.Column<int>(nullable: false),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProjectTeam", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ProjectTeamOperator",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    IsDeleted = table.Column<bool>(nullable: false),
                    OperatorID = table.Column<Guid>(nullable: false),
                    OperatorRoles = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    ProjectTeamID = table.Column<int>(nullable: false),
                    Status = table.Column<int>(nullable: false),
                    TenantId = table.Column<int>(nullable: false),
                    UpdateTime = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProjectTeamOperator", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Requirement",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    ClientTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    CreateOperator = table.Column<Guid>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    EnvironmentDevTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    EnvironmentOSTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    PlanFinish = table.Column<DateTime>(nullable: true),
                    PlanStart = table.Column<DateTime>(nullable: true),
                    ProjectDescription = table.Column<string>(type: "nvarchar(2000)", nullable: true),
                    ProjectTags = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    ProjectTitle = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    Status = table.Column<int>(nullable: false),
                    TenantId = table.Column<int>(nullable: false),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Requirement", x => x.Id);
                });
        }
    }
}
